3.85 \(\int \frac{(a+b x) (A+B x)}{x} \, dx\)

Optimal. Leaf size=24 \[ x (a B+A b)+a A \log (x)+\frac{1}{2} b B x^2 \]

[Out]

(A*b + a*B)*x + (b*B*x^2)/2 + a*A*Log[x]

________________________________________________________________________________________

Rubi [A]  time = 0.0094834, antiderivative size = 24, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 1, integrand size = 14, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.071, Rules used = {76} \[ x (a B+A b)+a A \log (x)+\frac{1}{2} b B x^2 \]

Antiderivative was successfully verified.

[In]

Int[((a + b*x)*(A + B*x))/x,x]

[Out]

(A*b + a*B)*x + (b*B*x^2)/2 + a*A*Log[x]

Rule 76

Int[((d_.)*(x_))^(n_.)*((a_) + (b_.)*(x_))*((e_) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*
x)*(d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, d, e, f, n}, x] && IGtQ[p, 0] && (NeQ[n, -1] || EqQ[p, 1]) && N
eQ[b*e + a*f, 0] && ( !IntegerQ[n] || LtQ[9*p + 5*n, 0] || GeQ[n + p + 1, 0] || (GeQ[n + p + 2, 0] && Rational
Q[a, b, d, e, f])) && (NeQ[n + p + 3, 0] || EqQ[p, 1])

Rubi steps

\begin{align*} \int \frac{(a+b x) (A+B x)}{x} \, dx &=\int \left (A b+a B+\frac{a A}{x}+b B x\right ) \, dx\\ &=(A b+a B) x+\frac{1}{2} b B x^2+a A \log (x)\\ \end{align*}

Mathematica [A]  time = 0.005144, size = 24, normalized size = 1. \[ x (a B+A b)+a A \log (x)+\frac{1}{2} b B x^2 \]

Antiderivative was successfully verified.

[In]

Integrate[((a + b*x)*(A + B*x))/x,x]

[Out]

(A*b + a*B)*x + (b*B*x^2)/2 + a*A*Log[x]

________________________________________________________________________________________

Maple [A]  time = 0.002, size = 22, normalized size = 0.9 \begin{align*}{\frac{bB{x}^{2}}{2}}+Abx+Bax+aA\ln \left ( x \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((b*x+a)*(B*x+A)/x,x)

[Out]

1/2*b*B*x^2+A*b*x+B*a*x+a*A*ln(x)

________________________________________________________________________________________

Maxima [A]  time = 1.13342, size = 30, normalized size = 1.25 \begin{align*} \frac{1}{2} \, B b x^{2} + A a \log \left (x\right ) +{\left (B a + A b\right )} x \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)*(B*x+A)/x,x, algorithm="maxima")

[Out]

1/2*B*b*x^2 + A*a*log(x) + (B*a + A*b)*x

________________________________________________________________________________________

Fricas [A]  time = 1.85879, size = 57, normalized size = 2.38 \begin{align*} \frac{1}{2} \, B b x^{2} + A a \log \left (x\right ) +{\left (B a + A b\right )} x \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)*(B*x+A)/x,x, algorithm="fricas")

[Out]

1/2*B*b*x^2 + A*a*log(x) + (B*a + A*b)*x

________________________________________________________________________________________

Sympy [A]  time = 0.279668, size = 22, normalized size = 0.92 \begin{align*} A a \log{\left (x \right )} + \frac{B b x^{2}}{2} + x \left (A b + B a\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)*(B*x+A)/x,x)

[Out]

A*a*log(x) + B*b*x**2/2 + x*(A*b + B*a)

________________________________________________________________________________________

Giac [A]  time = 1.21599, size = 30, normalized size = 1.25 \begin{align*} \frac{1}{2} \, B b x^{2} + B a x + A b x + A a \log \left ({\left | x \right |}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)*(B*x+A)/x,x, algorithm="giac")

[Out]

1/2*B*b*x^2 + B*a*x + A*b*x + A*a*log(abs(x))